<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="number" class="user"><br>
    <input type="number" class="yzm"><button class="btn1">获取验证码</button><br>
    <button class="btn2">登入</button>
    <script src="js/jquery.min.js"></script>
    <script>
        var btns=document.querySelectorAll("button");

        btns[0].onclick=function(){
            var value=$(".user").val();
            console.log(value);
            $.ajax({
                type:"get",
                url:'/captcha/sent',
                data:{phone:value},
                success:function(e){
                    console.log(e);
                }
            })
        }
        btns[1].onclick=function(){
            var value=$(".user").val();
            var value1=$(".yzm").val();
            console.log(value);
            console.log(value1);
            $.ajax({
                type:"get",
                url:'/login/cellphone?phone='+value+'&captcha='+value1,
                success:function(e){
                    console.log(e);
                    console.log(1);
                }
            })
        }
    </script>
</body>
</html>